#include "Configuration.hpp"
#include "smartHomeMonitorServer.hpp"

int main()
{
    wd::Configuration* config = wd::Configuration::getInstance("./server.conf");
    map<string,string> &config_map = config->getConfigMap();
    cout <<"ip:\t\t\t" <<config_map["ip"] << endl;
    cout <<"tcp_port:\t\t" <<config_map["tcp_port"] << endl;
    cout << "thread_num:\t\t"<< config_map["thread_num"]<< endl;
    cout << "task_num:\t\t"<<config_map["task_num"] << endl;
    
    /* wd::smartHomeMonitorServer server(4,10,12345,"0.0.0.0"); */
    wd::smartHomeMonitorServer server(stoi(config_map["thread_num"]),
                                      stoi(config_map["task_num"]),
                                      stoi(config_map["tcp_port"]),
                                      config_map["ip"]);
    
    server.start();


    return 0;
}

